package com.jshan.blog.base.admin.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 字典表
 * @TableName sys_dict
 */
@TableName(value ="sys_dict")
@Data
public class SysDict implements Serializable {
    /**
     * 字典id(规则)
     */
    @TableId
    private Integer id;

    /**
     * 关联sys_dict_type id
     */
    private Integer sysDictTypeId;

    /**
     * 字典名称
     */
    private String codeName;

    /**
     * 字典（Key）别名，某些情况下如果不想使用id作为key
     */
    private String alias;

    /**
     * 排序(正序)
     */
    private Integer sort;

    /**
     * 回显样式
     */
    private String callbackShowStyle;

    /**
     * 备注
     */
    private String remark;

    /**
     * 是否锁定
     */
    private Integer isLock;

    /**
     * 是否展示
     */
    private Integer isShow;

    /**
     * 是否删除
     */
    private Integer delFlag;

    /**
     *
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    /**
     *
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;

    /**
     *
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime deleteTime;

    /**
     *
     */
    private Integer createId;

    /**
     *
     */
    private Integer updateId;

    /**
     *
     */
    private Integer deleteId;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;
}
